/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 25228
 * Date: 2024-08-15
 * Time: 21:18
 */
public class Solution3 {
    public static void main(String[] args) {
        for (int i = 1; i <= 1000; i++) {
            for (int j = 1; j <= 1000; j++) {
                if(yue(i)==j && yue(j)==i && i!=j){
                    System.out.print("{"+i+","+j+"}");
                }
            }
        }
    }
    public static int yue(int x){
        int s=0;
        for (int i = 1; i <= x/2; i++) {
            if(x%i==0){
                s+=i;
            }
        }
        return s;
    }
}

